<template>
  <div class="box-item box-item-one">
    <div class="box-item-title">{{ title }}</div>
    <div class="padding-horizontal">
      <el-scrollbar wrap-class="scrollbar-wrap">
        <ul class="data-ul">
          <li class="data-li" v-for="(item, index) in info" :key="index">
            <p class="data-li-title">{{ item.title }}</p>
            <p class="data-li-content">
              <span class="data-number" :style="{color: themeColor}">{{ item.count }}</span>
              <span class="data-unit">{{ item.unit }}</span>
            </p>
          </li>
        </ul>
      </el-scrollbar>
    </div>
  </div>
</template>

<script>
export default {
  name: 'box-item-one',
  props: {
    title: {
      type: String
    },
    info: {
      type: Array,
      default () {
        return []
      }
    }
  },
  computed: {
    themeColor () {
      return this.$store.state.user.theme
    }
  }
}
</script>

<style lang="scss" scoped>
.data-ul {
  margin: 0;
  padding-left: 0;
  list-style: none;
}

.data-li {
  border-bottom: 1px solid var(--theme-color);
}
.data-li-title {
  margin-bottom: .5em;
}
.data-li-content {
  margin-top: 0;
}
</style>
